package com.chzc.dao;

import com.chzc.db.StudentDB;
import com.chzc.pojo.Student;

/**
 * @author CV大魔王
 * @Description
 * @date 2021/3/14 20:07
 */
public class StudentDao {

    /**
     * 登录
     *
     * @param userName 账号
     * @param pwd 密码
     * @return 学生对象
     */
    public Student login(String userName, String pwd) {
        for (Student student : StudentDB.students) {
            if (student.getUserName().equals(userName) && student.getPwd().equals(pwd)) {
                return student;
            }
        }
        return null;
    }
}
